package com.ug.common.exception;

import com.ug.common.enums.ErrorCode;

/**
 * @Author LY
 * @create 2024/8/5 11:31
 * @Description 自定义异常
 */
public class SystemException extends RuntimeException {

    private Integer code;

    public SystemException(String message) {
        super(message);
    }

    public SystemException(ErrorCode errorCode){
        this(errorCode.getCode(), errorCode.getMesaage());
    }

    public SystemException(Integer code, String messgae){
        super(messgae);
        this.code = code;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

}
